# import smtplib
# from email.mime.text import MIMEText
#
#
#
# def send_email(url,username,email):
#     msg_from = '40443937@qq.com'  # 发送方邮箱
#     passwd = 'ojkaxoovsydncage'  # 填入发送方邮箱的授权码(填入自己的授权码，相当于邮箱密码)
#
#     msg_to = email
#     print(msg_to)
#
#     subject = "【西红柿】找回密码" # 主题
#     content = f'尊敬的{username},您好!<br><br>您在西红柿网申请了找回密码,请点击 < a href = "{url}"target = "_blank" > 重置密码 < / a > 进行密码修改操作. < br > < br > 如果不是您本人的操作, 请忽略本次邮件!'
#     # 生成一个MIMEText对象（还有一些其它参数）
#
#     msg = MIMEText(content)
#     # 放入邮件主题
#     msg['Subject'] = subject
#
#     msg['From'] = msg_from
#
#     try:
#         # 通过ssl方式发送，服务器地址，端口
#         s = smtplib.SMTP_SSL("smtp.qq.com", 465)
#         # 登录到邮箱
#         s.login(msg_from, passwd)
#
#         # 发送邮件：发送方，收件方，要发送的消息
#         s.sendmail(msg_from, msg_to, msg.as_string())
#         print('成功')
#         return True
#     except smtplib.SMTPException as e:
#         print(e)




